/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Raven
 */
@ManagedBean
@SessionScoped
public class AccessBean {
    private String name;
    private String password;
    private String pass;
    /**
     * Creates a new instance of AccessBean
     */
    public AccessBean() {
        
    }

    public String getName() {
        System.out.println("Entro al get");
        return name;
    }

    public void setName(String name) {
                System.out.println("Entro al set");
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
        
        
    }
    //----------------Acciones--------------------------
    
    public String validarLogin()
            {
            if(name.equals("root")&&password.equals("12345"))
            {
            return "MenuPrincipal";
            }
        else
            {
            return "Pagina2";
            }
            }
    //-----------------Listener------------------------------

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
}
